home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.20010306-20010921 / 000264_fdc@watsun.cc.columbia.edu_Thu Jul 12 16:18:51 EDT 2001.msg < prev    next >
Text File  |  2020-01-01  |  3KB  |  83 lines

  1. Article: 12595 of comp.protocols.kermit.misc
  2. Path: newsmaster.cc.columbia.edu!watsun.cc.columbia.edu!fdc
  3. From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
  4. Newsgroups: comp.protocols.kermit.misc
  5. Subject: Re: ssh script example
  6. Date: 12 Jul 2001 20:19:08 GMT
  7. Organization: Columbia University
  8. Lines: 66
  9. Message-ID: <9il0ns$3h8$1@newsmaster.cc.columbia.edu>
  10. References: <a695e0e6.0107121149.6d5ab7bb@posting.google.com>
  11. NNTP-Posting-Host: watsun.cc.columbia.edu
  12. X-Trace: newsmaster.cc.columbia.edu 994969148 3624 128.59.39.2 (12 Jul 2001 20:19:08 GMT)
  13. X-Complaints-To: postmaster@columbia.edu
  14. NNTP-Posting-Date: 12 Jul 2001 20:19:08 GMT
  15. Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:12595
  16.  
  17. In article <a695e0e6.0107121149.6d5ab7bb@posting.google.com>,
  18. Andy Pyles <a_pyles@yahoo.com> wrote:
  19. : I'm using c-kermit 7.0 on a redhat 6.2 linux machine.
  20. : and trying to script a simple ssh login script.
  21. : ~~~~~~~~~~~~~~~~~~~~~~~
  22. : #!/usr/bin/kermit  +
  23. : ; expect script that will automatically upgrade telverse ui files on
  24. : ; remote system. using the ssh protocol.
  25. : ; usage uiupgrade username hostname password
  26. : ;set prefixing all
  27. : set transaction-log verbose
  28. : log session session.log
  29. : set host /pty ssh -l \%1 \%2
  30. : if fail out failed!!
  31. : input 10 password:
  32. : if fail out no password prompt!
  33. : out \%3\13
  34. : input 10 ]$
  35. : out touch /tmp/blaHH\13
  36. : input 10 ]$
  37. : out exit\13
  38. : lineout ~.
  39. : logout
  40. : exit
  41. : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  42. : Ok, so the problem I have is when I run this script I just get the following:
  43. : [andy@dev1 images]$ ./ssh_kermit.ker andy dev1 password
  44. : no password prompt!password
  45. : touch /tmp/blaHH
  46. : [andy@dev1 images]$
  47. : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  48. : any clue on what I'm doing wrong here?
  49. I don't see anything obviously wrong with the script, but...
  50.  
  51.  1. This should work better in C-Kermit 8.0:
  52.  
  53.       http://www.columbia.edu/kermit/ck80.html
  54.  
  55.     The pty interface didn't work right with scripting on every
  56.     platform; please try 8.0 and see that improves matters.
  57.  
  58.  2. Maybe there really was no password: prompt.  You can use
  59.     "set input echo on" to watch what happens.
  60.  
  61.  3. "if fail out no password prompt!" just sends "no password prompt!"
  62.     to the pty.  Maybe you meant:
  63.  
  64.       if fail exit 1 No password prompt.
  65.  
  66.  4. The the rest of the INPUT statements all should have "if fail" clauses
  67.     after them.
  68.  
  69.  5. If you use:
  70.  
  71.       set host /pty -e none ...
  72.  
  73.     then you shouldn't need the "lineout ~." and "logout".
  74.  
  75. - Frank
  76.